SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE [dbo].ComprasDeleteCommand
(
	@Original_ID numeric(10, 0),
	@Original_ID_CONDICION numeric(10, 0),
	@Original_TIPO bit,
	@Original_ID_USUARIO numeric(10, 0),
	@Original_FECHA date,
	@Original_F_VENCIMIENTO date,
	@Original_ID_SUPLIDOR numeric(10, 0),
	@Original_NRO_FACTURA varchar(30),
	@IsNull_NCF Int,
	@Original_NCF varchar(19),
	@IsNull_OBSERVACIONES Int,
	@Original_OBSERVACIONES varchar(150),
	@Original_ACTIVO bit
)
AS
	SET NOCOUNT OFF;
DELETE FROM [COMPRAS] WHERE (([ID] = @Original_ID) AND ([ID_CONDICION] = @Original_ID_CONDICION) AND ([TIPO] = @Original_TIPO) AND ([ID_USUARIO] = @Original_ID_USUARIO) AND ([FECHA] = @Original_FECHA) AND ([F_VENCIMIENTO] = @Original_F_VENCIMIENTO) AND ([ID_SUPLIDOR] = @Original_ID_SUPLIDOR) AND ([NRO_FACTURA] = @Original_NRO_FACTURA) AND ((@IsNull_NCF = 1 AND [NCF] IS NULL) OR ([NCF] = @Original_NCF)) AND ((@IsNull_OBSERVACIONES = 1 AND [OBSERVACIONES] IS NULL) OR ([OBSERVACIONES] = @Original_OBSERVACIONES)) AND ([ACTIVO] = @Original_ACTIVO))
GO
